<html>
<head>
<h1>Delete Student Record</h1>
</head>

<body>
<form action="delstudent.php" method="GET">
Student ID: <input type='text' name = 'Studentid' /> <br/>
<input type='submit' name = 'Delete' value='Delete'/>
</form>
</body>
<?php
	//require "config.php";
	error_reporting(0);
	$Studentid = $_GET['Studentid'];
	
	//$con = mysql_connect("localhost",$db_user ,$db_pass);
	$con = mysql_connect("mysql","admin","admin");


	// if an error was encountered, the script exits with an error message
	if (!$con){
		die('Could not connect: ' . mysql_error());
    }
	//after successfully connecting with the database server, select the database with which you want to communicate
	mysql_select_db("CMPE 138",$con);
	
	$sql_del = "DELETE FROM Student WHERE StudentId = '$Studentid'";
	$result1 = mysql_query($sql_del);
	mysql_close($con);
?>
<br />
<a href="student.php">Home</a>
</html>
